package com.xiaobias.user.service;

import com.xiaobias.user.mapper.UserMapper;
import com.xiaobias.user.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserService {

    private final UserMapper userMapper;

    @Autowired
    public UserService(UserMapper userMapper) {
        this.userMapper = userMapper;
    }

    /**
     * 根据ID查询用户
     */
    public User queryById(Long id) {
        // 查询用户并返回
        return this.userMapper.findById(id);
    }
}
